import 'package:daoyi_admin_ui_getx/app/data/cache_keys.dart';
import 'package:daoyi_admin_ui_getx/app/routes/app_pages.dart';
import 'package:flustars/flustars.dart';
import 'package:flutter/material.dart';

import 'package:get/get.dart';

import '../controllers/login_controller.dart';

class LoginView extends GetView<LoginController> {
  const LoginView({super.key});

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: const Text('LoginView'),
        centerTitle: true,
      ),
      body: Center(
        child: ElevatedButton(
          onPressed: () async {
            await SpUtil.putBool(CacheKeys.authIsLogin, true);
            print("auth " + SpUtil.getBool(CacheKeys.authIsLogin).toString());
            Get.offNamed(Routes.TABS);
          },
          child: const Text("模拟登录，点一下就行"),
        ),
      ),
    );
  }
}
